package com.yoooya.base.type;

/**
 * 缩略图类型
 * 
 * @author Sun Yijing<br />
 *         Copyright © Xiamen Yoooya NetWorks Co.,Ltd.
 * @since yoooya software platform v1.0.0
 * @version 1.0.0 <br />
 *          <table border="1" cellpadding="3" cellspacing="0">
 *          <tr>
 *          <th align="left" colspan="3"><b>修改历史</b></th>
 *          </tr>
 *          <tr>
 *          <td>修改日期</td>
 *          <td>修改人</td>
 *          <td>修改描述</td>
 *          </tr>
 *          <tr>
 *          <td>2018-6-20</td>
 *          <td>Sun Yijing</td>
 *          <td>新建</td>
 *          </tr>
 *          </table>
 */
public enum ThumbnailType {

	/**
	 * 原图
	 */
	Original(0, 0),

	/**
	 * 64 * 64图片
	 */
	Scale1(64, 64),

	/**
	 * 100 * 100图片
	 */
	Scale2(100, 100),

	/**
	 * 310 * 310图片
	 */
	Scale3(310, 310),

	/**
	 * 640 * 640图片
	 */
	Scale4(640, 640);

	private int width;
	private int height;

	ThumbnailType(int width, int height) {
		this.width = width;
		this.height = height;
	}

	public static ThumbnailType valueOf(int ordinal) {
		if (ordinal < 1 || ordinal >= values().length) {
			return null;
		}
		return values()[ordinal];
	}

	public int getWidth() {
		return width;
	}

	public int getHeight() {
		return height;
	}
}
